import { Models } from "../typings/model"
class Result {

    public static success(param?: Models.ResultParam): Models.Result{
        const result: Models.Result = {
            message: param?.msg || 'ok',
            state: 1,
            results:param?.results,
            error: null,
            name: 'result error'
        }
        return result
    }

    public static fail(param?: Models.FailResultParam): Models.Result{
        const result: Models.Result = {
            message: param?.msg || 'fail',
            state: 0,
            results: null,
            error: param?.error
        }
        return result
    }
}

export default Result